Reduce rounding error. (#154658, John Cupitt)
authorMatthias Clasen <mclasen@redhat.com>
Thu, 7 Oct 2004 03:44:58 +0000 (03:44 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Thu, 7 Oct 2004 03:44:58 +0000 (03:44 +0000)
2004-10-06  Matthias Clasen  <mclasen@redhat.com>

* gtk/gtkpaned.c (gtk_paned_compute_position): Reduce rounding
error.  (#154658, John Cupitt)

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtkpaned.c

index 5265afbc949c7ec499c0aa570b1172dced2cc7dd..2f7988e7a51f87c52956d29ce57427f77f725acc 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2004-10-06  Matthias Clasen  <mclasen@redhat.com>
 
+       * gtk/gtkpaned.c (gtk_paned_compute_position): Reduce rounding 
+       error.  (#154658, John Cupitt)
+
        * gtk/gtktreeselection.c (gtk_tree_selection_get_selected): Clear
        the iter instead of returning it unmodified. (#154186, Jonathan Blandford)
 
index 5265afbc949c7ec499c0aa570b1172dced2cc7dd..2f7988e7a51f87c52956d29ce57427f77f725acc 100644 (file)
@@ -1,5 +1,8 @@
 2004-10-06  Matthias Clasen  <mclasen@redhat.com>
 
+       * gtk/gtkpaned.c (gtk_paned_compute_position): Reduce rounding 
+       error.  (#154658, John Cupitt)
+
        * gtk/gtktreeselection.c (gtk_tree_selection_get_selected): Clear
        the iter instead of returning it unmodified. (#154186, Jonathan Blandford)
 
index 5265afbc949c7ec499c0aa570b1172dced2cc7dd..2f7988e7a51f87c52956d29ce57427f77f725acc 100644 (file)
@@ -1,5 +1,8 @@
 2004-10-06  Matthias Clasen  <mclasen@redhat.com>
 
+       * gtk/gtkpaned.c (gtk_paned_compute_position): Reduce rounding 
+       error.  (#154658, John Cupitt)
+
        * gtk/gtktreeselection.c (gtk_tree_selection_get_selected): Clear
        the iter instead of returning it unmodified. (#154186, Jonathan Blandford)
 
index 5265afbc949c7ec499c0aa570b1172dced2cc7dd..2f7988e7a51f87c52956d29ce57427f77f725acc 100644 (file)
@@ -1,5 +1,8 @@
 2004-10-06  Matthias Clasen  <mclasen@redhat.com>
 
+       * gtk/gtkpaned.c (gtk_paned_compute_position): Reduce rounding 
+       error.  (#154658, John Cupitt)
+
        * gtk/gtktreeselection.c (gtk_tree_selection_get_selected): Clear
        the iter instead of returning it unmodified. (#154186, Jonathan Blandford)
 
index c484205f6207891a3190dd6527e8f207457fbd69..a6a4ef68239ac7b30f06356c6ca6674400f3f088 100644 (file)
@@ -1180,9 +1180,9 @@ gtk_paned_compute_position (GtkPaned *paned,
       else if (!paned->child1_resize && paned->child2_resize)
        paned->child1_size = child1_req;
       else if (child1_req + child2_req != 0)
-       paned->child1_size = allocation * ((gdouble)child1_req / (child1_req + child2_req));
+       paned->child1_size = allocation * ((gdouble)child1_req / (child1_req + child2_req)) + 0.5;
       else
-       paned->child1_size = allocation * 0.5;
+       paned->child1_size = allocation * 0.5 + 0.5;
     }
   else
     {
@@ -1194,7 +1194,7 @@ gtk_paned_compute_position (GtkPaned *paned,
          if (paned->child1_resize && !paned->child2_resize)
            paned->child1_size += allocation - paned->last_allocation;
          else if (!(!paned->child1_resize && paned->child2_resize))
-           paned->child1_size = allocation * ((gdouble) paned->child1_size / (paned->last_allocation));
+           paned->child1_size = allocation * ((gdouble) paned->child1_size / (paned->last_allocation)) + 0.5;
        }
     }